Repository navigation
Backport #139 to 6.18-lts: fix(xen): block in stop_machine while a vCPU is not running - #142
Merged
Conversation
Under a credit2 cap, Xen parks a domain's vCPUs when its budget runs out. CPUs spinning in multi_cpu_stop() then use the budget that a parked vCPU needs to reach the next step, so taking a vCPU offline, at boot on PV or when the vCPU count is lowered, slows down sharply as the cap shrinks. Implement stop_machine_yield() for x86 Xen guests, like for s390: while a CPU taking part is not running, block in Xen with SCHEDOP_poll and a short timeout instead of spinning. Guests on KVM's Xen emulation are not supported: KVM reads the SCHEDOP_poll timeout as relative, unlike Xen, and wakes a poller with interrupts off on few events, so a waiter there can sleep for a very long time and stop_machine can hang once the host preempts a vCPU. Signed-off-by: Alexander M. Merritt <alexander@edera.dev> (cherry picked from commit e899db9)
alexandermerritt
approved these changes
Dec 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport of #139 from
edera/mainlinetoedera/6.18-lts(79b32c529f09), prepared by Claude. Run log.Merge with Rebase and merge, so
edera/6.18-ltsstays linear.Independent checks
Builds: success (x86_64 and arm64 vmlinux with the Edera features built in).
79b32c529f092d48e6e996cbClaude's report
Claude left no report (backport step: success).